package com.oros.db;

import java.util.Arrays;
import java.io.Serializable;

public class AEUniqueIndexItem implements Serializable {

	private static final long serialVersionUID = -2524961411550369630L;
   public Object[] items;
   public Object id; 
   private int hashcode,itemnmb;
   public AEUniqueIndexItem(Object[] items,Object id)
   {
	   itemnmb = items.length;
	   this.items = items;
	   this.id = id;
	   hashcode=20082006;
	   for(int i=0;i<itemnmb;i++) 
	   {
		   Object a=items[i];
		   if (a!=null) hashcode=hashcode * 31 + a.hashCode();
	   }
   }
@Override
public int hashCode() {
	return hashcode;
}
@Override
public boolean equals(Object obj) {
	if (obj == null)
		return false;
	if (getClass() != obj.getClass())
		return false;
	AEUniqueIndexItem other = (AEUniqueIndexItem) obj;
	if (!Arrays.equals(items, other.items))
		return false;
	return true;
}
@Override
public String toString() {
	return "item "  + id +" with unique fields "+ Arrays.toString(items);
}
   
}
